package com.zmx.doctor.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.doctor.R;
import com.zmx.doctor.pojo.PrescriptionMouldDetails;

import butterknife.BindView;
import butterknife.ButterKnife;

//
public class PrescriptionMouldDetailsAdapter  extends BaseAdapterRvList<PrescriptionMouldDetailsAdapter.ViewHolder, PrescriptionMouldDetails> {


    public PrescriptionMouldDetailsAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, PrescriptionMouldDetails prescriptionMouldDetails) {

        holder.instructions.setText("用法："+prescriptionMouldDetails.getUsage());
        holder.name.setText(prescriptionMouldDetails.getGoods_name());
        holder.number.setText("数量："+prescriptionMouldDetails.getNumber());

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {
        PrescriptionMouldDetailsAdapter.ViewHolder holder = new PrescriptionMouldDetailsAdapter.ViewHolder(inflater.inflate(R.layout.adapter_prescription_mould_details, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.name)
        TextView name;
        @BindView(R.id.number)
        TextView number;
        @BindView(R.id.instructions)
        TextView instructions;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }


}
